//
// Created by lenovo on 25-4-17.
//

#include "Test.h"
//解决名称冲突，返回对象本身用*this
Test::Test(string name, int age) {
    this->name = name;
    this->age = age;
}
Test::Test() {

}
Test::~Test() {

}
void Test::information()
{
    cout<<"学生姓名："<<this->name<<endl;
    cout<<"学生年龄:"<<this->age<<endl;
}

Test & Test::addAge(Test &p) {
    this->age += p.age;
    return *this;
}
